# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gperf

pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.0.4
pkgrel=2
pkgdesc="Perfect hash function generator (mingw-w64)"
arch=('any')
url="http://www.gnu.org/software/gperf/"
license=('GPL3')
#groups=("${MINGW_PACKAGE_PREFIX}")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
source=("http://ftp.gnu.org/pub/gnu/gperf/${_realname}-${pkgver}.tar.gz"{,.sig})
sha1sums=('e32d4aff8f0c730c9a56554377b2c6d82d0951b8'
          'SKIP')
options=('strip')

build() {
  mkdir ${srcdir}/build-${MINGW_CHOST}
  cd "${srcdir}"/build-${MINGW_CHOST}
  ../${_realname}-${pkgver}/configure \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --prefix=${MINGW_PREFIX}
  make
}

check() {
  cd "${srcdir}"/build-${MINGW_CHOST}
  make check
}

package() {
  cd "${srcdir}"/build-${MINGW_CHOST}
  make DESTDIR="${pkgdir}" install
  rm -rf ${pkgdir}${MINGW_PREFIX}/share
}
